package com.learner.course.controller.api;

import com.learner.course.repository.CourseMediaRepository;
import com.learner.course.service.VideoService;
import com.learner.pojo.course.CourseMedia;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @author ice2020x
* @Date: 2023/3/9
* @Description:
**/
@RequestMapping("/api/edu/video")
@RestController
public class ApiCourseVideoController {

    @Autowired
    private VideoService videoService;



    /**
     * 获取课程计划
     *
     * @param planId 计划id
     * @return 媒体信息
     */
    @GetMapping("/getVideoByPlanId/{id}")
    public CourseMedia getVideoByPlanId(@PathVariable("id") String planId) {
        return videoService.findByPlanId(planId);
    }

}
